import request from '@/utils/request'

export function query(data) {
  return request({
    url: `/md/reportWork/getCanReportWorkData`,
    method: 'post',
    data
  })
}

// 确认报工
export function confirmWork(data) {
  return request({
    url: `/md/reportWork/okReportWork`,
    method: 'POST',
    data
  })
}

// 报工查询列表
export function queryList(data) {
  return request({
    url: '/md/reportWork/selectReportWorkInfo',
    method: 'post',
    data
  })
}
// 当前用户报工数量查询
export function queryWorkRecord(data) {
  return request({
    url: '/md/reportWork/selectReportWorkRecord',
    method: 'post',
    data
  })
}

// 修改更新报工数据
export function updateWork(data) {
  return request({
    url: `/md/reportWork/updateReportWorkInfo`,
    method: 'post',
    data
  })
}

// 批量修改状态
export function batchUpdate(data) {
  return request({
    url: `/md/reportWork/updateWorkState`,
    method: 'post',
    data
  })
}

// 用户获取工步
export function getWorkStepList() {
  return request({
    url: `/md/reportWork/getStationByUser`,
    method: 'get'
  })
}

// 报工查询页导出
export function exportExcel(data) {
  return request({
    url: `/md/reportWork/export`,
    responseType: 'blob',
    method: 'post',
    data
  })
}
// 报废SFC查询
export function getScrapInfoBySfc(sfc) {
  return request({
    url: `/md/reportWork/getScrapInfoBySfc?sfc=${sfc}`,
    method: 'get'
  })
}

// 报废登记
export function scrapRegister(data) {
  return request({
    url: `/md/reportWork/scrapRegister`,
    method: 'post',
    data
  })
}
